package com.bear.atlassianmcp.confluence.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Confluence用户数据模型
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ConfluenceUser {

    private String type;
    private String username;
    private String userKey;
    private String accountId;
    private String displayName;
    private String email;
    private Boolean active;
    private String timeZone;
    private String locale;

    /**
     * 格式化为AI友好的文本描述
     */
    public String toFormattedString() {
        StringBuilder sb = new StringBuilder();
        sb.append("👤 用户: ").append(displayName != null ? displayName : username).append("\n");
        
        if (username != null) {
            sb.append("🔑 用户名: ").append(username).append("\n");
        }
        
        if (email != null) {
            sb.append("📧 邮箱: ").append(email).append("\n");
        }
        
        if (timeZone != null) {
            sb.append("🌍 时区: ").append(timeZone).append("\n");
        }
        
        if (locale != null) {
            sb.append("🌐 语言: ").append(locale).append("\n");
        }
        
        sb.append("✅ 状态: ").append(active != null && active ? "活跃" : "非活跃").append("\n");
        
        return sb.toString();
    }

    // Getters and Setters
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserKey() {
        return userKey;
    }

    public void setUserKey(String userKey) {
        this.userKey = userKey;
    }

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }

    public String getLocale() {
        return locale;
    }

    public void setLocale(String locale) {
        this.locale = locale;
    }
}
